<? /* license

BilugCMS (http://www.bilug.it) - Content Management System for dynamic web sites
Copyright (C) 2005-2008  Federico Villa and Alessio Loro Piana

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

For reference, contact bilugcms@vilnet.it


license */ ?>

	<script type="text/javascript">
	jQuery().ready(function(){
		
		// second simple accordion with special markup
		jQuery('#navigation').accordion({
			active: false,
			header: '.head',
			navigation: true,
			event: 'mouseover',
			fillSpace: true,
			animated: 'easeslide'
		});
		
	});
	</script>

<?
function according($id, $parametro)
{
	
	//query dove estraggo le voci del sottomenu 
	$query="SELECT id, titolo, link, posizione FROM menutipo WHERE tipo='$parametro' and idpadre=$id ORDER BY posizione";
	$risultato=mysql_query($query);
	$row=mysql_num_rows($risultato);
	{
		echo"<ul>";
		while($voci=mysql_fetch_row($risultato))
		{
			switch($voci[3])
			{
					case "nw":
								echo"\t<li><a href=\"index.php?pag=argo.php&argo=$voci[2]\"><h4>$voci[1]</h4></a></li>\n";
						break;
					case "st":
								echo"\t<li><a href=\"index.php?pag=static.php&stat=$voci[2]\"><h4>$voci[1]</h4></a></li>\n";
						break;
					case "gl":
								echo"\t<li><a href=\"index.php?pag=../utility/galleria.php&$voci[2]\"><h4>$voci[1]</h4></a></li>\n";
						break;
					case "ex":
								echo"\t<li><a href=\"$voci[2]\" target=\"_blank\"><h4>$voci[1]</h4></a></li>\n";
						break;
					case "hm":
									echo"\t<li><a href=\"index.php\"><h4>$voci[1]</h4></a></li>\n";
							break;
					case "sc":
									echo"\t<li><a href=\"index.php?pag=../custom/mail.php\"><h4>$voci[1]</h4></a></li>\n";
						break;
					case "ec":
								echo"\t<li><a href=\"index.php?pag=ecommerce.php\"><h4>$voci[1]</h4></a></li>\n";
						break;
			}
		
		}	
		echo"</ul>";
	}

}

 
$parametro = "a3";

	//query dove estraggo le voci principali del menu 'alto'
	$query1="SELECT id, titolo, link, posizione FROM menutipo WHERE tipo='$parametro' and idpadre=0 ORDER BY posizione";
	$risultato1=mysql_query($query1);
	$row1=mysql_num_rows($risultato1);
	//$principale=mysql_fetch_row($risultato1);

		
	//cero il menu con <ul> incatenati
		if($row1>0)
		{
			echo"<ul id=\"navigation\">\n";
				while($principale=mysql_fetch_row($risultato1))
				{
					echo"\t<li><a class=\"head\" href=\"#\"><h3>$principale[1]</h3></a>\n";
							$funz=according($principale[0], $parametro);	
					echo "</li>\n";				
				}			
			echo "</ul>\n";		
		}





?>
